package com.info.provider.entity;

import com.mars.app.base.BaseEntity;
import com.mars.app.wetchat.WaterMark;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;

import java.util.Date;

/**
 * Created by pengshuo on 2018/1/3 16:05
 * Description:
 * Modified By:
 * Version:
 *
 * @author pengshuo
 */
@Data
@NoArgsConstructor
public class UserInfo extends BaseEntity {

    /** 用户在本系统 唯一识别号 */
    @Id
    private String uuid;

    /** 微信用户 唯一识别号 */
    private String openId;

    /** 用户在开放平台的唯一标识符 */
    private String unionId;

    /** 微信昵称 */
    private String nickName;

    /** 微信图片 */
    private String avatarUrl;

    /** 性别
     * 1：男
     * 2：女
     */
    private Integer gender;

    /** 国家 */
    private String country;

    /** 省份 */
    private String province;

    /** 城市 */
    private String city;

    /** 语言 */
    private String language;

    /** 手机号码 */
    private String phone;

    /** 创建时间 */
    private Date createDate;

    /** 修改时间 */
    private Date updateDate;

    /** 非数据库字段 数据水印 */
    private WaterMark watermark;

    public UserInfo(String openId) {
        this.openId = openId;
    }

    public UserInfo(String openId, String unionId, String nickName,
                    String avatarUrl, Integer gender, String country,
                    String province, String city, String language) {
        this.openId = openId;
        this.unionId = unionId;
        this.nickName = nickName;
        this.avatarUrl = avatarUrl;
        this.gender = gender;
        this.country = country;
        this.province = province;
        this.city = city;
        this.language = language;
    }

    public UserInfo(String uuid,String openId,String unionId,  String nickName,
                    String avatarUrl, Integer gender, String country,
                    String province, String city, String language) {
        this.uuid = uuid;
        this.openId = openId;
        this.unionId = unionId;
        this.nickName = nickName;
        this.avatarUrl = avatarUrl;
        this.gender = gender;
        this.country = country;
        this.province = province;
        this.city = city;
        this.language = language;
    }
}
